This invention relates generally to the field of managing computer files and objects in a computer system, and more particularly relates to maintaining one master object attribute table in a file system having multiple directories linked to a file.
A computer system can be considered as three major components: (1) the application programs, such as a spreadsheet or word processing or graphics presentation application, which are used by the user; (2) the operating system that transparently manages the application""s interactions with other applications and the computer hardware; and (3) the computer hardware comprising the processor, the random access memories, the actual electronic components which manage the magnetic and/or optical bits. The operating system has a kernel which, inter alia, controls the execution of applications, processes, and/or objects by allowing their creation, termination or suspension, and communication; schedules processes/objects of the same or different applications on the hardware, allocates memory for those objects, administers free space, controls access to the objects, and retrieves objects and data for the user. The term object is used herein to at least include a named storage space having a set of characteristics that describes itself and, in some cases, includes data. More broadly, an object is anything that exists in and occupies space in storage and on which operations can be performed, for example, programs, files, libraries, directories, and folders.
FIG. 1 is an example of a hierarchical file system 10 as is known in the art. The basic building block of a hierarchical file system 10 is the directory or root object 12 which is the anchor for objects linked into the file system 10. Such an example of the root object may be the directory named/xe2x80x9cslashxe2x80x9d, which by convention may be an interior rotating memory component of the computer system. From the root object 12 there may be links to multiple child directory objects 14 and 16, each of which may be linked to other child objects 18 or to stream or record files 20. The hierarchy will terminate in an empty directory 26, a record file, or a stream file as is shown as 20 and 24 in FIG. 1. The ability to create and link a child directory into a parent directory is the means by which a hierarchical file system is built.
All file systems, whether or not hierarchically implemented, require the use of an Object Attribute Table (OAT). The OAT stores attribute information for each object linked into the file system. Attributes include information such as time stamps, the number of links, object size, owner identifier, object type, access permissions, etc. Many file systems, for instance that which is part of the UNIX operating system, implement a single OAT, called an inode list in UNIX, for the entire file system. The inode list maintains the state of the file system. Administrators specify the size of the inode list when configuring a file system. In UNIX, the internal representation of a file or object is an inode (a contraction of the term index node). The inode contains a description of the disk layout of the file data and other information, e.g., such as the file owner, access permissions, and access times. Every file has one inode but may have several names all of which map into the inode. When a process refers to a file by name, the kernel parses the file name along its hierarchical path one component at a time, checks that the process has permission to search the directories in the path, and eventually retrieves the inode for the file.
A file system that is based upon a system-wide OAT such as the inode list of UNIX has two inherent disadvantages. First, a bottleneck is created across the entire system whenever an entry is allocated or deallocated in the system-wide OAT. The bottleneck results from the required synchronization to ensure that multiple processes are not accessing or modifying the OAT at the same time. Without this synchronization the OAT becomes corrupted. Second, the entire file system is at risk of becoming damaged, and perhaps unrecoverable, if the memory component that contains the system-wide OAT experiences hardware failures.
Instead of a single system-wide OAT or inode list, a separate OAT can be used for each directory object within the file system. Each directory object owns or maintains an OAT that contains object attributes only for objects linked by that directory. When an object has multiple links to one or more directories, however, a new problem is created because there are multiple copies of the object attributes in one or more OATs. Thus, all the multiple copies of the attributes have to be updated whenever the object""s attributes are changed, which in certain situations, degrades performance and jeopardizes the integrity of the file system.
There is thus a need in the industry to provide multiple OATs while at the same time maintaining a single copy of the object attributes across the entire file system even when an object has multiple links.
These needs and others that will become apparent to one skilled in the art are satisfied by a file system comprising a master object attribute table entry in a first directory object linked to a file and storing the attributes for the file; and at least one slave object attribute table entry in a second directory object linked to the file, the at least one slave object attribute table entry not storing the attributes for the file.
The first directory object may be one of a plurality of directory objects, and the slave object attribute table entry may be in another directory object or the same directory object as the master object attribute table entry.
The slave object attribute table entries link their respective directory(ies) to the file, and the master object attribute table entry points to those slave object attribute table entries linking to the file according to a protocol. The protocol may be unidirectional, bidirectional, or such that the master object attribute table entry and all slave object attribute table entries point to each other.
In the file system, the master object attribute table entry and all the slave object attribute table entries may be of comparable size to contain the same attribute information of the file.
Another aspect of the invention is a system to manage objects in a digital processing system, comprising a master entry in a object attribute table of a first directory object linked to a file and storing the attributes for the file; at least one placeholder entry having at least a space the same size as the master entry which may be in the object attribute table of the first directory object or another directory object, the placeholder entry also linked to the file and containing a pointer, the placeholder entry capable of but not storing the attributes for the file, and a pointer protocol in which a master pointer in the master entry and the placeholder pointer are aware of their respective addresses and the address of the linked file.
Yet another embodiment of the invention is a method for storing attributes of an object in a file system, comprising the steps of creating a master object attribute table entry in a first directory linking to an object and storing the attributes of the object in that entry, storing the address of the master object attribute table entry in the object header, and creating at least one slave object attribute table entry in a second directory linking to the object, the at least one slave object attribute table entry not having the attributes of the file but capable of storing the object""s attributes.
The method above may further comprise initiating deallocation of the master directory object attribute table entry, finding a candidate object attribute table entry among the slave object attribute table entries according to a pointing protocol, qualifying the candidate object attribute table entry to be the new master object attribute table entry, copying the attributes of the file to the new master object attribute table entry, updating a header in the file to address the new master object attribute table entry, and updating a pointer in all the slave attribute table entries to maintain the pointing protocol.
Another aspect of the invention is a data storage medium capable of transferring a program of machine readable instructions executable by a computer to perform method steps to manage a file system, the method steps comprising: creating a second object attribute table entry in a directory in the file system and linking it to a file that has already been linked to a first object attribute table entry to the file, the first object attribute table entry having the attributes of the file, the second object attribute table entry having a placeholder capable of but not storing the attributes of the file; and updating the first object attribute table entry to include a pointer to the second object attribute table entry. The data storage medium may further comprise machine readable instructions to qualify the second object attribute table entry to receive the file""s attributes; transfer the attributes of the file from the first object attribute table entry to the second object attribute table entry; deallocate the first object attribute table entry; update the file to address the second object attribute table entry; and update any subsequent object table entries also linked to the file to point to the second object attribute table entry as having the file""s attributes.
The invention is also a file system in a computer system, comprising: a means to create a file having a plurality of attributes; a means to create a plurality of directories; a means to create a plurality of attribute table entries in each directory that is linked to the file; and a means to store the plurality of attributes in only one of the attribute table entries. The file system above may further comprise a means to deallocate the one attribute table entry in which the plurality of attributes are stored; a means to qualify another of the plurality of attribute table entries to store the plurality of attributes; a means to transfer the plurality of attributes to the qualified attribute table entry; a means to update the file to address the qualified attribute table entry having the file""s attributes; and a means to update the pointers of the plurality of attribute table entries to indicate that the qualified attribute table entry has the file""s attributes.
The invention is also a data processing system capable of executing objects and maintaining a file system, comprising: a processing unit connected to a memory apparatus; an operating system to manipulate and control access to files; a plurality of peripheral devices connected to the processing unit on a bus, the peripheral devices to provide input and output to the data processing system; a plurality of files used by the data processing system to process data; a user interface with which a user can manipulate the operating system to access files; an application program interface with which an application program can manipulate the operating system to access files; a plurality of directory objects, each containing at least an attribute table having a number of entries corresponding to the files linked to its respective directory object; a master entry in one of the plurality of directory objects containing the attributes of the file to which it is linked; and at least one slave entry in one of the plurality of directory objects capable of but not containing the attributes of the file to which it is linked, and containing a pointer to at least one other entry linked to the file.